CXX = mpic++
MODELS_DIR = ../../../models
CPPFLAGS += -Wall -g -I ../../.. -I$(MODELS_DIR)/processor -I$(MODELS_DIR)/cache -I$(MODELS_DIR)/network -I$(MODELS_DIR)/memory
LDFLAGS = -liris -L$(MODELS_DIR)/network/iris -lmcp-cache -L$(MODELS_DIR)/cache/mcp-cache -lZesto -L$(MODELS_DIR)/processor/zesto -lcaffdram  -L$(MODELS_DIR)/memory/CaffDRAM  -L../../../kernel -lmanifold 

EXECS = iris_ring  iris_torus


ALL: $(EXECS)


iris_ring: iris_ring.o
	$(CXX) $^ -o$@  $(LDFLAGS) -lconfig++

iris_torus: iris_torus.o
	$(CXX) $^ -o$@  $(LDFLAGS) -lconfig++


%.o: %.cc
	@[ -d dep ] || mkdir dep
	$(CXX) $(CPPFLAGS) $(CXXFLAGS) -MMD -MF dep/$*.d -c $< -o $*.o

-include $(wildcard dep/*.d)

.PHONY: clean
clean:
	rm -f $(EXECS) *.d *.o DBG* core*.out
	rm -rf dep
